<?php
	include_once('../public/config/config.php');
	include_once('../public/config/sql.php');

	// 实例化对象
	$obj = new sql($info);

	$id = isset($_GET['id']) ? $_GET['id'] : ''; //接受率id值

	// 构建SQL语句
	$sql = "select img,name,username,password,email,content,state from users where id=?";

	$data = $obj->db_select($sql, false, null, null, null, $id);

?>
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>	
	<div class="myIframe_box">
		<div class="iframe_title">
			<div class="iframe_title_c">
				<div class="title_c_l">
					<span>用户编辑</span>
				</div>
			</div>
		</div>
		<div class="title_b_hint"><button onclick="return history.back(-1);">返回上一级</button></div>

		<div class="middle_box">
			<div class="middle_center">
				<form action="./pose/users_updateAction.php" method="post" enctype="multipart/form-data" class="myform">
					<div class="file_box clearBoth">
						<lable>头像</lable>
						<p><input type="file" name="file"><span>文件上传</span></p>
						<p id="arrImg"><img src="./public/image/banner2.jpg" alt=""></p>
					</div>
					<p>
						<lable>昵称</lable>
						<input type="text" name="name" value="<?php echo $data['name'];?>">
					</p>
					<p>
						<lable>用户名</lable>
						<input type="text" name="users" value="<?php echo $data['username'];?>" disabled>
					</p>
					<p>
						<lable>密码</lable>
						<input type="password" name="passOne" value="<?php echo $data['password'];?>">
					</p>
					<p>
						<lable>确认密码</lable>
						<input type="password" name="passTwo" value="<?php echo $data['password'];?>">
					</p>
					<p>
						<lable>状态</lable>
						<select name="state">
							<?php
								$stateOne = $data['state'] == 0 ? '正常' : '异常';

								$stateTwo = $stateOne == 0 ? 1 : 0;
								$stateTwo = $stateOne == 1 ? 0 : 1;
								$text = $stateTwo == 1 ? '异常' : '正常';
								echo '<option value="'. $data['state'] .'">'. $stateOne .'</option>';
								echo '<option value="'. $stateTwo .'">'. $text .'</option>';

							?>
						</select>
					</p>
					<p>
						<lable>邮箱</lable>
						<input type="email" name="email" value="<?php echo $data['email']?>">
					</p>
					<p>
						<lable>个性签</lable>
						<textarea name="content" id="" cols="30" rows="10"><?php echo $data['content'];?></textarea>
					</p>
					<input type="hidden" name="id" value="<?php echo $id;?>">
					<input id="btn" type="submit" value="保存">
				</form>
			</div>
		</div>
	</div>
</body>
</html>